<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Source::Path - bundler: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Source.html">Bundler::Source</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-from_lock">::from_lock</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3D-3D">#==</a>
    <li ><a href="#method-i-app_cache_dirname">#app_cache_dirname</a>
    <li ><a href="#method-i-app_cache_path">#app_cache_path</a>
    <li ><a href="#method-i-cache">#cache</a>
    <li ><a href="#method-i-cached-21">#cached!</a>
    <li ><a href="#method-i-eql-3F">#eql?</a>
    <li ><a href="#method-i-expand">#expand</a>
    <li ><a href="#method-i-expanded_original_path">#expanded_original_path</a>
    <li ><a href="#method-i-expanded_path">#expanded_path</a>
    <li ><a href="#method-i-generate_bin">#generate_bin</a>
    <li ><a href="#method-i-has_app_cache-3F">#has_app_cache?</a>
    <li ><a href="#method-i-hash">#hash</a>
    <li ><a href="#method-i-install">#install</a>
    <li ><a href="#method-i-load_gemspec">#load_gemspec</a>
    <li ><a href="#method-i-load_spec_files">#load_spec_files</a>
    <li ><a href="#method-i-local_specs">#local_specs</a>
    <li ><a href="#method-i-lockfile_path">#lockfile_path</a>
    <li ><a href="#method-i-name">#name</a>
    <li ><a href="#method-i-relative_path">#relative_path</a>
    <li ><a href="#method-i-remote-21">#remote!</a>
    <li ><a href="#method-i-root">#root</a>
    <li ><a href="#method-i-specs">#specs</a>
    <li ><a href="#method-i-to_lock">#to_lock</a>
    <li ><a href="#method-i-to_s">#to_s</a>
    <li ><a href="#method-i-validate_spec">#validate_spec</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Source::Path">
    <h1 id="class-Bundler::Source::Path" class="class">
      class Bundler::Source::Path
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_GLOB">DEFAULT_GLOB
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">name</span><span
                class="attribute-access-type">[W]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-options" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">options</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-original_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">original_path</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">path</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-root_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">root_path</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">version</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-from_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">from_lock</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="from_lock-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">from_lock</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-string">&quot;path&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;remote&quot;</span>)))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@glob</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;glob&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">DEFAULT_GLOB</span>

  <span class="ruby-ivar">@allow_cached</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@allow_remote</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-ivar">@root_path</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;root_path&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">root</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;path&quot;</span>]
    <span class="ruby-ivar">@path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;path&quot;</span>])
    <span class="ruby-identifier">expanded_path</span> = <span class="ruby-identifier">expand</span>(<span class="ruby-ivar">@path</span>)
    <span class="ruby-ivar">@path</span> = <span class="ruby-keyword">if</span> <span class="ruby-ivar">@path</span>.<span class="ruby-identifier">relative?</span>
      <span class="ruby-identifier">expanded_path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">root_path</span>.<span class="ruby-identifier">expand_path</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">expanded_path</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@name</span>    = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;name&quot;</span>]
  <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;version&quot;</span>]

  <span class="ruby-comment"># Stores the original path. If at any point we move to the</span>
  <span class="ruby-comment"># cached directory, we still have the original path to copy from.</span>
  <span class="ruby-ivar">@original_path</span> = <span class="ruby-ivar">@path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3D-3D" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">==</span><span
                                class="method-args">(other)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Path.html#method-i-eql-3F">eql?</a>
                            </div>
                          </div>

                  <div id="method-i-app_cache_dirname" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_cache_dirname</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_cache_dirname-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 118</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_cache_dirname</span>
  <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cache" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cache</span><span
                                class="method-args">(spec, custom_path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cache-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 92</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cache</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">custom_path</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">app_cache_path</span> = <span class="ruby-identifier">app_cache_path</span>(<span class="ruby-identifier">custom_path</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">feature_flag</span>.<span class="ruby-identifier">cache_all?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">expand</span>(<span class="ruby-ivar">@original_path</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">root_path</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;/&quot;</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@original_path</span>.<span class="ruby-identifier">exist?</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-node">&quot;Can&#39;t cache gem #{version_message(spec)} because #{self} is missing!&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">app_cache_path</span>)
  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp_r</span>(<span class="ruby-node">&quot;#{@original_path}/.&quot;</span>, <span class="ruby-identifier">app_cache_path</span>)
  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-identifier">app_cache_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.bundlecache&quot;</span>))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cached-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cached!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cached-21-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 48</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cached!</span>
  <span class="ruby-ivar">@local_specs</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@allow_cached</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-eql-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eql?</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="eql-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 72</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eql?</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>
  <span class="ruby-identifier">expanded_original_path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">expanded_original_path</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Path.html#method-i-3D-3D">==</a>
                            </div>

                          </div>

                  <div id="method-i-expanded_original_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expanded_original_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="expanded_original_path-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 126</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expanded_original_path</span>
  <span class="ruby-ivar">@expanded_original_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">original_path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-hash" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">hash</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="hash-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">hash</span>
  [<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">expanded_path</span>, <span class="ruby-identifier">version</span>].<span class="ruby-identifier">hash</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">(spec, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 84</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">using_message</span> = <span class="ruby-node">&quot;Using #{version_message(spec, options[:previous_spec])} from #{self}&quot;</span>
  <span class="ruby-identifier">using_message</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot; and installing its executables&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">executables</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">print_using_message</span> <span class="ruby-identifier">using_message</span>
  <span class="ruby-identifier">generate_bin</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-value">:disable_extensions</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">nil</span> <span class="ruby-comment"># no post-install message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-local_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local_specs</span><span
                                class="method-args">(*)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local_specs-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 106</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local_specs</span>(<span class="ruby-operator">*</span>)
  <span class="ruby-ivar">@local_specs</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">load_spec_files</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="name-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 80</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">expanded_path</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-remote-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">remote!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="remote-21-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 43</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">remote!</span>
  <span class="ruby-ivar">@local_specs</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@allow_remote</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-root" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">root</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="root-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 122</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">root</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 110</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">has_app_cache?</span>
    <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">app_cache_path</span>
    <span class="ruby-ivar">@expanded_path</span> = <span class="ruby-keyword">nil</span> <span class="ruby-comment"># Invalidate</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">local_specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_lock</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_lock-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_lock</span>
  <span class="ruby-identifier">out</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;PATH\n&quot;</span>)
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  remote: #{lockfile_path}\n&quot;</span>
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  glob: #{@glob}\n&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@glob</span> <span class="ruby-operator">==</span> <span class="ruby-constant">DEFAULT_GLOB</span>
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;  specs:\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_s</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 64</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-node">&quot;source at `#{@path}`&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-app_cache_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_cache_path</span><span
                                class="method-args">(custom_path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_cache_path-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 153</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_cache_path</span>(<span class="ruby-identifier">custom_path</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@app_cache_path</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">app_cache</span>(<span class="ruby-identifier">custom_path</span>).<span class="ruby-identifier">join</span>(<span class="ruby-identifier">app_cache_dirname</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-expand" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expand</span><span
                                class="method-args">(somepath)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="expand-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 136</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expand</span>(<span class="ruby-identifier">somepath</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">current_ruby</span>.<span class="ruby-identifier">jruby?</span> <span class="ruby-comment"># TODO: Unify when https://github.com/rubygems/bundler/issues/7598 fixed upstream and all supported jrubies include the fix</span>
    <span class="ruby-identifier">somepath</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root_path</span>).<span class="ruby-identifier">expand_path</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">somepath</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root_path</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">e</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">PathError</span>, <span class="ruby-string">&quot;There was an error while trying to use the path &quot;</span> \
    <span class="ruby-node">&quot;`#{somepath}`.\nThe error message was: #{e.message}.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-expanded_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expanded_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="expanded_path-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 132</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expanded_path</span>
  <span class="ruby-ivar">@expanded_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_bin" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_bin</span><span
                                class="method-args">(spec, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_bin-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 222</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_bin</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">gem_dir</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">full_gem_path</span>)

  <span class="ruby-comment"># Some gem authors put absolute paths in their gemspec</span>
  <span class="ruby-comment"># and we have to save them from themselves</span>
  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span> = <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword">unless</span> <span class="ruby-regexp">/\A#{Pathname::SEPARATOR_PAT}/</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">begin</span>
      <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">gem_dir</span>).<span class="ruby-identifier">to_s</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
      <span class="ruby-identifier">path</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-identifier">installer</span> = <span class="ruby-constant">Path</span><span class="ruby-operator">::</span><span class="ruby-constant">Installer</span>.<span class="ruby-identifier">new</span>(
    <span class="ruby-identifier">spec</span>,
    <span class="ruby-value">:env_shebang</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">false</span>,
    <span class="ruby-value">:disable_extensions</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:disable_extensions</span>],
    <span class="ruby-value">:build_args</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:build_args</span>],
    <span class="ruby-value">:bundler_extension_cache_path</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">extension_cache_path</span>(<span class="ruby-identifier">spec</span>)
  )
  <span class="ruby-identifier">installer</span>.<span class="ruby-identifier">post_install</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidSpecificationException</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;\n#{spec.name} at #{spec.full_gem_path} did not have a valid gemspec.\n&quot;</span> \
                  <span class="ruby-string">&quot;This prevents bundler from installing bins or native extensions, but &quot;</span> \
                  <span class="ruby-string">&quot;that may not affect its functionality.&quot;</span>

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">spec</span>.<span class="ruby-identifier">extensions</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">spec</span>.<span class="ruby-identifier">email</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;If you need to use this package without installing it from a gem &quot;</span> \
                    <span class="ruby-node">&quot;repository, please contact #{spec.email} and ask them &quot;</span> \
                    <span class="ruby-string">&quot;to modify their .gemspec so it can work with `gem build`.&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;The validation message from RubyGems was:\n  #{e.message}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-has_app_cache-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">has_app_cache?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="has_app_cache-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 157</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_app_cache?</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">in_bundle?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">app_cache_path</span>.<span class="ruby-identifier">exist?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_gemspec</span><span
                                class="method-args">(file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_gemspec-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 161</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_gemspec</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load_gemspec</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">set_installed_by_version</span>(<span class="ruby-identifier">spec</span>)
  <span class="ruby-identifier">spec</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_spec_files" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_spec_files</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_spec_files-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 171</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_spec_files</span>
  <span class="ruby-identifier">index</span> = <span class="ruby-constant">Index</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">expanded_path</span>)
    <span class="ruby-comment"># We sort depth-first since `&lt;&lt;` will override the earlier-found specs</span>
    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">glob_files_in_dir</span>(<span class="ruby-ivar">@glob</span>, <span class="ruby-identifier">expanded_path</span>).<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-operator">-</span><span class="ruby-identifier">p</span>.<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>).<span class="ruby-identifier">size</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span> = <span class="ruby-identifier">load_gemspec</span>(<span class="ruby-identifier">file</span>)
      <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">source</span> = <span class="ruby-keyword">self</span>

      <span class="ruby-comment"># Validation causes extension_dir to be calculated, which depends</span>
      <span class="ruby-comment"># on #source, so we validate here instead of load_gemspec</span>
      <span class="ruby-identifier">validate_spec</span>(<span class="ruby-identifier">spec</span>)
      <span class="ruby-identifier">index</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@name</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@version</span>
      <span class="ruby-identifier">index</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>     = <span class="ruby-ivar">@name</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>   = <span class="ruby-keyword">self</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span>  = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Version</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@version</span>)
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">platform</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">summary</span>  = <span class="ruby-node">&quot;Fake gemspec for #{@name}&quot;</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">relative_loaded_from</span> = <span class="ruby-node">&quot;#{@name}.gemspec&quot;</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">authors</span> = [<span class="ruby-string">&quot;no one&quot;</span>]
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">expanded_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;bin&quot;</span>).<span class="ruby-identifier">exist?</span>
          <span class="ruby-identifier">executables</span> = <span class="ruby-identifier">expanded_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;bin&quot;</span>).<span class="ruby-identifier">children</span>
          <span class="ruby-identifier">executables</span>.<span class="ruby-identifier">reject!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">p</span>) }
          <span class="ruby-identifier">s</span>.<span class="ruby-identifier">executables</span> = <span class="ruby-identifier">executables</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">basename</span>.<span class="ruby-identifier">to_s</span> }
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">message</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;The path `#{expanded_path}` &quot;</span>)
    <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">expanded_path</span>)
      <span class="ruby-string">&quot;is not a directory.&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-string">&quot;does not exist.&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">PathError</span>, <span class="ruby-identifier">message</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">index</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lockfile_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lockfile_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="lockfile_path-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 148</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lockfile_path</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">relative_path</span>(<span class="ruby-identifier">original_path</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">original_path</span>.<span class="ruby-identifier">absolute?</span>
  <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">original_path</span>).<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">root</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-relative_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">relative_path</span><span
                                class="method-args">(path = self.path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="relative_path-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 215</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">relative_path</span>(<span class="ruby-identifier">path</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">root_path</span>.<span class="ruby-identifier">to_s</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">root_path</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_spec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_spec</span><span
                                class="method-args">(spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_spec-source">
            <pre><span class="ruby-comment"># File bundler/source/path.rb, line 167</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_spec</span>(<span class="ruby-identifier">spec</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">spec</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

